<template>
	<view :data-theme="theme">
		<view class="card">
			<view class="title-content">
				<view style="display: flex;padding: 20rpx 20rpx 0 20rpx; justify-content: space-between;">
					<view class="title">
						{{closingNo}}
					</view>
					<view class="title-c" style="padding: 10rpx;border-radius: 8rpx;color: #201b8c;">
						{{auditStatus[closingDetail.auditStatus] ? auditStatus[closingDetail.auditStatus] : ''}}
					</view>
				</view>
				<view style="border-bottom: 1px solid #f6f6f6;margin: 20rpx;"></view>
				<view class="column" style="display: flex;justify-content: space-between;">
					<view class="font-weight-content">
						转账金额
					</view>
					<view class="font-weight-content">
						{{closingDetail.amount}}元
					</view>
				</view>
				<view style="display: flex;padding: 20rpx;justify-content: space-between;">
					<view class="title">
						收款方式
					</view>
					<view class="title-c">
						{{closingType[closingDetail.closingType]}}
					</view>
				</view>
				
				<view style="display: flex;padding: 20rpx;justify-content: space-between;">
					<view class="title">
						到账状态
					</view>
					<view class="title-c" style="color: #201b8c;">
						{{accountStatus[closingDetail.accountStatus]}}
					</view>
				</view>
				<view style="display: flex;padding: 20rpx;justify-content: space-between;">
					<view class="title">
						审核时间
					</view>
					<view class="title-c">
						{{closingDetail.auditTime ? closingDetail.auditTime : '-'}}
					</view>
				</view>
				<view style="border-bottom: 1px solid #f6f6f6;margin: 20rpx;"></view>
			</view>
		</view>
		<view class="card" v-if="closingDetail.closingType == 'wechat'">
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					真实姓名
				</view>
				<view class="title-c">
					{{closingDetail.closingName}}
				</view>
			</view>
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					微信号
				</view>
				<view class="title-c">
					{{closingDetail.wechatNo}}
				</view>
			</view>
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					收款二维码
				</view>
				<view class="title-c">
				<u--image :showLoading="true" :src="closingDetail.paymentCode" width="80px" height="80px"
					class="top_left"></u--image>
				</view>
			</view>
		</view>
		<view class="card" v-if="closingDetail.closingType == 'alipay'">
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					真实姓名
				</view>
				<view class="title-c">
					{{closingDetail.closingName}}
				</view>
			</view>
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					支付宝账号
				</view>
				<view class="title-c">
					{{closingDetail.paymentCode ? closingDetail.paymentCode : '-'}}
				</view>
			</view>
		</view>
		<view class="card" v-if="closingDetail.closingType == 'bank'">
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					开户户名
				</view>
				<view class="title-c">
					{{closingDetail.closingName ? closingDetail.closingName : '-'}}
				</view>
			</view>
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					开户银行
				</view>
				<view class="title-c">
					{{closingDetail.closingBank ? closingDetail.closingBank : '-'}}
				</view>
			</view>
			<view style="display: flex;padding: 20rpx;justify-content: space-between;">
				<view class="title">
					银行账号
				</view>
				<view class="title-c">
				{{closingDetail.closingBankCard ? closingDetail.closingBankCard : '-'}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getClosingDetailApi
	} from '@/api/finance.js';
	import {
		setThemeColor
	} from '../../../utils/setTheme';
	let app = getApp();
	export default {
		data() {
			return {
				bgColor: "#ffffff",
				theme: app.globalData.theme,
				closingNo: '',
				closingDetail: {}, //详情
				auditStatus: {
					0: '待审核',
					1: '已通过',
					2: '未通过'
				},
				accountStatus: {
					0: '未到账',
					1: '已到账'
				},
				closingType: {
					bank: '银行卡',
					wechat: '微信',
					alipay: '支付宝',
				}
			};
		},
		onLoad(options) {
			this.bgColor = setThemeColor()
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.bgColor,
			});
			this.closingNo = options.data;

			this.getClosingDetail();
		},
		methods: {
			getClosingDetail() {
				getClosingDetailApi(this.closingNo).then((res) => {
					this.closingDetail = res.data;
				})
			}
		}
	}
</script>

<style lang="scss">
	.card {
		background-color: #fff;
		margin: 20rpx;
		border-radius: 10rpx;
	}

	.font-weight-content {
		font-weight: bold;
	}

	.column {
		padding: 20rpx;
		display: flex;
		flex-flow: row;
		text-align: center;
		justify-content: space-between;

		.title {
			display: flex;
			// flex: 1;
			width: 150rpx;
		}

		.title-c {
			display: flex;
			flex: 1;
			justify-content: left;
			// padding-left: 20rpx;
		}
	}
</style>